package sskj.regulatory.presentation.adapter

import android.content.Context
import android.view.ViewGroup
import com.jude.easyrecyclerview.adapter.BaseViewHolder
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter
import kotlinx.android.synthetic.main.item_signed.view.*
import kotlinx.android.synthetic.main.item_sitevideo.view.*
import sskj.regulatory.R
import sskj.regulatory.domain.entity.sitevideo.Site

class SiteVideoRecyclerArrayAdapter(context: Context?) : RecyclerArrayAdapter<Site>(context) {

    override fun OnCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<*> {
        return ItemViewHolder(parent)
    }

    internal inner class ItemViewHolder(parent: ViewGroup) : BaseViewHolder<Site>(parent, R.layout.item_sitevideo) {


        override fun setData(data: Site) {

            itemView.mTitleTv.text = data.name
            //itemView.mBjRqTv.text = data.bjrq
            itemView.mXxjdTv.text = data.xxjd
            //itemView.mSiteVideoIv.setImageResource(data.picpriviewurl!!)


//            if (data?.docqz != null && data?.docqz) {
//                itemView.msCaSummaryZtTv?.text = "已签"
//                //itemView.msCaSummaryZtTv?.background = resources.getDrawable(R.drawable.sign_yes_border)
//                //msCaSummaryZtTv.setTextColor(  R.color.material_green_500  );
//                // gradientDrawable.setStroke( 1, R.color.material_red_500);
//
//                //gradientDrawable.setColor( R.color.material_green_500 );
//            } else {
//                itemView.msCaSummaryZtTv?.text = "未签"
//                //itemView.msCaSummaryZtTv?.background = resources.getDrawable(R.drawable.sign_no_border)
//
//            }
        }
    }

}